<?php

/** @var \Laravel\Lumen\Routing\Router $router */

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

use Illuminate\Support\Facades\Route;


$router->get('/', function () use ($router) {
    return "aiparinter";//$router->app->version();
});

$router->get('/test', function () use ($router) {
    return response("error",500);
});

$router->group(['prefix' => 'user'], function () use ($router) {
    //$router->get('info', ['uses' => 'UserController@getInfo']);
    $router->post('login_google', ['uses' => 'UserController@loginGoogle']);
    $router->post('login_apple', ['uses' => 'UserController@loginApple']);
    $router->post('login_weixin', ['uses' => 'UserController@loginWeixin']);
    $router->post('login_qq', ['uses' => 'UserController@loginQq']);
    $router->post('edit_nickname', ['uses' => 'UserController@editNickname']);
    $router->post('edit_image', ['uses' => 'UserController@editImage']);
    $router->post('delete', ['uses' => 'UserController@delete']);
    $router->get('get_info', ['uses' => 'UserController@getCurUser']);
    $router->get('get_opus_info', ['uses' => 'UserController@getOpusInfo']);
    $router->post('login_jsweixin', ['uses' => 'UserController@loginJSWeixin']);
    $router->post('login_facebook', ['uses' => 'UserController@loginFacebook']);
    $router->post('login_new', ['uses' => 'UserController@loginNew']); 
    $router->post('restore_apple', ['uses' => 'UserController@restoreApple']);//Apple恢复购买
    $router->get("my_style_list",['uses' => 'UserController@getMyStyleList']);
    $router->get("get_user_is_pay",['uses' => 'UserController@getUserIsPay']);//获取当前用户是否付费过
    $router->get("get_user_is_old_vip",['uses' => 'UserController@getUserIsOldVip']);//获取当前用户是否是非会员老用户
});


$router->group(['prefix' => 'system'], function () use ($router) {
    $router->get('init', ['uses' => 'SystemController@init']);
    $router->get('put_file', ['uses' => 'SystemController@getPutfileUrl']);
    $router->get('click', ['uses' => 'SystemController@adClick']);
    $router->get('estimatetime', ['uses' => 'SystemController@getEstimateTime']);
    $router->get('estimate', ['uses' => 'SystemController@getEstimate']);
    $router->get('update', ['uses' => 'SystemController@update']);
    $router->get('get_discount', ['uses' => 'SystemController@getDiscount']);
    $router->post('upload', ['uses' => 'SystemController@uploadFile']);
    $router->post('event', ['uses' => 'SystemController@event']);  //用户行为记录
    $router->get('get_request', ['uses' => 'SystemController@getRequest']);
    $router->post('af_google_notify', ['uses' => 'SystemController@afGoogleNotify']);
    $router->post('af_apple_notify', ['uses' => 'SystemController@afAppleNotify']);
    $router->get('index', ['uses' => 'SystemController@index']);
    $router->get('subscribe_top', ['uses' => 'SystemController@subscribeTop']);
});

$router->group(['prefix' => 'opus'], function () use ($router) {
    $router->post('print_test', ['uses' => 'OpusController@testPrint']);
    $router->post('print', ['uses' => 'OpusController@print']);
    $router->get('task', ['uses' => 'OpusController@task']);
    $router->get('get_cur_user_list', ['uses' => 'OpusController@getSelfList']);
    $router->get('get_top_list', ['uses' => 'OpusController@getTopList']);
    $router->get('get_example_list', ['uses' => 'OpusController@getExampleList']);
    $router->get('get_new_list', ['uses' => 'OpusController@getNewList']);
    $router->post('set_title', ['uses' => 'OpusController@setTitle']);
    $router->post('set_titlex', ['uses' => 'OpusController@setTitlex']);
    $router->get('del', ['uses' => 'OpusController@del']);
    $router->get('del_task', ['uses' => 'OpusController@delTask']);
    $router->get('read', ['uses' => 'OpusController@read']);
    $router->get('get_styles', ['uses' => 'OpusController@getStyles']);
    $router->post('print_style', ['uses' => 'OpusController@printStyle']);
    $router->post('print_senior', ['uses' => 'OpusController@printSenior']);
    $router->get('is_buy', ['uses' => 'OpusController@isBuy']);
    $router->get('get_buy', ['uses' => 'OpusController@getBuyList']);
    $router->get('search', ['uses' => 'OpusController@search']);
    $router->post('print_anime', ['uses' => 'OpusController@printAnime']);
    $router->get('get_anime_example', ['uses' => 'OpusController@getAnimeExample']);
    $router->get('get_anime_images', ['uses' => 'OpusController@getAnimeImages']);
    $router->get('detail', ['uses' => 'OpusController@getOpusDetail']);
    $router->post('contribution', ['uses' => 'OpusController@contribution']);
    $router->get('message', ['uses' => 'OpusController@message']);
    $router->post('examine', ['uses' => 'OpusController@examine']);
    $router->post('onclick', ['uses' => 'OpusController@onclick']);
    $router->get('get_tab', ['uses' => 'OpusController@getTab']);

    $router->post('free_print', ['uses' => 'OpusController@freePrint']);
    // $router->post('put_free', ['uses' => 'OpusController@freePut']);
    $router->post('other_print', ['uses' => 'OpusController@otherPrint']);
    $router->post('anime_print', ['uses' => 'OpusController@printAnimeNew']);
    $router->post('anime_photo', ['uses' => 'OpusController@printAnimePhoto']);
    $router->get('get_draw_style', ['uses' => 'OpusController@getDrawStyle']);
    $router->get('get_free_num', ['uses' => 'OpusController@getFreeNum']);
    $router->get('get_draw_info', ['uses' => 'OpusController@getDrawInfo']);
    $router->get('get_new_top_list', ['uses' => 'OpusController@getNewTopList']);

    //获取画板预制词  getDrawingBoardPrepare
    $router->post('get_draw_board_prepare', ['uses' => 'OpusController@getDrawingBoardPrepare']);

    $router->post('check_nohigh_alert', ['uses' => 'OpusController@checkNoHighAlert']);

    // $router->post('createVideoCallback', ['uses' => 'OpusController@createVideoCallback']);
    $router->post('createVideoCallback', ['uses' => 'ShellController@videoWebHooks']);
    

    $router->post('createVideo', ['uses' => 'OpusController@createVideo']);

    // $router->get('test', ['uses' => 'OpusController@test']);
});


$router->group(['prefix' => 'pay'], function () use ($router) {
    $router->get('rules', ['uses' => 'PayController@getPayList']);
    $router->get('rules_discount', ['uses' => 'PayController@getDiscountPayList']);
    $router->post('create', ['uses' => 'PayController@createOrder']);
    $router->post('weixin_notify/{accountName}', ['uses' => 'PayController@weixinNotify']);
    $router->post('apple_notify', ['uses' => 'PayController@appleNotify']);
    $router->post('google_notify', ['uses' => 'PayController@googleNotify']);
    $router->post('alipay_notify', ['uses' => 'PayController@alipayNotify']);
    //谷歌商品一次性购买与订阅
    $router->post('google_notify_new', ['uses' => 'PayController@googleNotifyNew']);
    //苹果商品一次性购买与订阅
    $router->post('apple_notify_new', ['uses' => 'PayController@appleNotifyNew']);
    //苹果商品首次订阅绑定用户
    $router->post('apple_subscribe_bind', ['uses' => 'PayController@appleSubscribeBind']);
    $router->get('dot_rules', ['uses' => 'PayController@getDotRules']);
    //谷歌支付成功后，客户端通知服务端结果，在谷歌异步通知基础上再做一层保证，防止谷歌异步通知不到的情况
    $router->post('google_client_notify', ['uses' => 'PayController@googleClientNotify']);
    //获取谷歌支付订单信息
    $router->post('google_order_info', ['uses' => 'PayController@googleOrderInfo']);
    //获取苹果支付订单信息
    $router->post('apple_order_info', ['uses' => 'PayController@appleOrderInfo']);
    $router->get('test88', ['uses' => 'PayController@getTest88']);
    $router->get('get_rule_discount_list', ['uses' => 'PayController@getRuleDiscountList']);//获取折扣列表
});

$router->group(["prefix" => "model"],function () use ($router){
    $router->get('index', ['uses' => 'ModelController@index']);
    $router->get('new_index', ['uses' => 'ModelController@new_index']);
    $router->get('all', ['uses' => 'ModelController@all']);
    $router->get('new_all', ['uses' => 'ModelController@new_all']);
    $router->get('img2img', ['uses' => 'ModelController@img2img']);
    $router->get('style_list', ['uses' => 'ModelController@style_list']);
    $router->get('new_style_list', ['uses' => 'ModelController@new_style_list']);
    $router->get('style_detail', ['uses' => 'ModelController@style_detail']);
    $router->get('img2img_detail', ['uses' => 'ModelController@img2img_detail']);
    $router->post('prepare_txt', ['uses' => 'ModelController@prepare_txt']);
    $router->post('task_txt', ['uses' => 'ModelController@task_txt']);
    $router->post('task_img', ['uses' => 'ModelController@task_img']);
    $router->post('task_model', ['uses' => 'ModelController@task_model']);
    $router->post('task_txt_video', ['uses' => 'ModelController@task_txt_video']);
    
    $router->post('buy_style',['uses' => 'ModelController@buy_style']);
});

$router->group(["prefix" => "common"],function () use ($router){
    $router->post('report_img', ['uses' => 'CommonController@reportImg']);
});


$router->group(["prefix" => "shell"],function () use ($router){
    $router->get('check_google_pay_order', ['uses' => 'ShellController@checkGooglePayOrder']);
    $router->get('check_apple_pay_order', ['uses' => 'ShellController@checkApplePayOrder']);
    $router->get('del_redis_key', ['uses' => 'ShellController@delRedisKey']);
    $router->get('tongji', ['uses' => 'ShellController@tongji']);
    $router->get('del_user_opus', ['uses' => 'ShellController@bathDelOpusImg']);
    $router->get('ceshi', ['uses' => 'ShellController@ceshi']);
    $router->post('img_webhooks', ['uses' => 'ShellController@imgWebHooks']);
    $router->get('auto_del_task_img', ['uses' => 'ShellController@autoDelTaskImg']);
    $router->get('format_refund_time', ['uses' => 'ShellController@formatOrderRefundTime']);
    $router->post('video_webhooks', ['uses' => 'ShellController@videoWebHooks']);
    $router->post('image_video_webhooks', ['uses' => 'ShellController@imageVideoWebHooks']);
});



